/**
 * Created by clakeboy on 16/7/2.
 */

import React from 'react';

import ReactDOM from 'react-dom';

import '../Assets/css/notfound';

export default class NotFound extends React.Component {
    constructor() {
        super();

        this.state = {
            name:'页面未找到',
            isload:false
        };
    }

    componentDidMount() {
        setTimeout(()=>{
            this.setState({
                isload:true
            });
        },1000);

        // setTimeout((function(){
        //     this.setState({
        //         isload:true
        //     });
        // }).bind(this),1000);

    }

    shouldComponentUpdate(nextProps,nextState) {
        if (this.state.isload == nextState.isload) {
            return false;
        }
    }

    render() {
        if (!this.state.isload) {
            return (
                <div className="main">正在加载</div>
            );
        }

        return (
            <div id="sss" ref="clake" className="main">
                {this.state.name}
            </div>
        );
    }
}

const styles = {
    main: {
        display:'flex',
        justifyContent:'center',
        height:'200px',
        alignItems:'center',
        border:'1px solid red'
    }
};